package com.scs.dao;

import com.scs.pojo.relation;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface relationMapper {
    int relationInsert(relation item);
    List<relation> getAllRelation();
    int batchDeleteRelation(List<String> list);
    List<relation> selectRelationByTeacherId(String teacherId);

    @Select("select * from relation where courseName like '%${key}%' or teacherName like '%${key}%'")
    List<relation> getRelationByKey(@Param(value = "key") String key);

    @Delete("delete from relation where relationId = #{relationId}")
    int delRelation(String relationId);
    List<relation> selectCourseByClasses(String classes);
    List<relation> selectClassesByTeacherIdAndCourseName(String teacherId, String courseName);
}
